package com.fypg.module.medical.dal.mysql.hospitalarea;

import java.util.*;

import com.fypg.framework.common.pojo.PageResult;
import com.fypg.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.fypg.framework.mybatis.core.mapper.BaseMapperX;
import com.fypg.module.medical.dal.dataobject.hospitalarea.HospitalAreaDO;
import org.apache.ibatis.annotations.Mapper;
import com.fypg.module.medical.controller.admin.hospitalarea.vo.*;

/**
 * 医院区域信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface HospitalAreaMapper extends BaseMapperX<HospitalAreaDO> {

    default PageResult<HospitalAreaDO> selectPage(HospitalAreaPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HospitalAreaDO>()
                .eqIfPresent(HospitalAreaDO::getEncode, reqVO.getEncode())
                .likeIfPresent(HospitalAreaDO::getHospitalAreaName, reqVO.getHospitalAreaName())
                .eqIfPresent(HospitalAreaDO::getSortCode, reqVO.getSortCode())
                .eqIfPresent(HospitalAreaDO::getDescription, reqVO.getDescription())
                .eqIfPresent(HospitalAreaDO::getAreaType, reqVO.getAreaType())
                .eqIfPresent(HospitalAreaDO::getCityType, reqVO.getCityType())
                .eqIfPresent(HospitalAreaDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(HospitalAreaDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(HospitalAreaDO::getId));
    }

}